#pragma once
#include <iostream>
#include <vector>
#include <unistd.h>

#include "sst_table.h"
#include "level_non_zero.h"
#include "level_zero.h"

namespace VirtualR {

class Disk {
 public:
  Disk(std::string dir);
  std::pair<bool, std::string> search(std::string key);
  void clear();
  bool add(SkipList &mem);

 private:
  std::vector<LevelNonZero> level_non_zero_vec_;
  LevelZero level_zero_;
  // 分配no_
  uint64_t no_{0};
  std::string dir_;
  void dump_to_disk();
  uint64_t success_count_{0};
  uint64_t fail_count_{0};
};

} // namespace VirtualR